#include <iostream>
#include <cmath>

using namespace std;

void printDiamond(int n) {
int mid = n / 2;
    for (int i = 0; i < n; i++) {
        int spaces = abs(mid - i);
        for (int j = 0; j < spaces; j++) {
            cout << " ";
        }
        int stars = n - 2 * spaces;
        for (int j = 0; j < stars; j++) {
            cout << "*";
        }
        cout << endl;
    }
}

int main() {
    int n;
    cout << "请输入行数n: ";
    cin >> n;
    
    
    if (n % 2 == 0) {
        cout << "输入的行数必须是奇" << endl;
        n++;
    }
    
    printDiamond(n);
    return 0;
}